;;; init-treemacs.el --- Configuration for treemacs -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(define-key winum-keymap (kbd "M-0") #'treemacs-select-window)

(with-eval-after-load 'treemacs
  ;; (setq treemacs-indentation-string "⫶"
  ;;       treemacs-indentation 1)
  (setq treemacs-project-follow-cleanup t)
  (setq treemacs-no-delete-other-windows nil)
  ;; (setq aw-ignored-buffers (delete 'treemacs-mode aw-ignored-buffers))
  (treemacs-resize-icons 15)

  (defun treemacs-expand-when-first-used (&optional visibility)
    (when (or (null visibility) (eq visibility 'none))
      (treemacs-do-for-button-state
       :on-root-node-closed (treemacs-toggle-node)
       :no-error t)))

  (add-hook 'treemacs-select-functions #'treemacs-expand-when-first-used)
  (add-hook 'treemacs-switch-workspace-hook #'treemacs-expand-when-first-used))

(provide 'init-treemacs)
;;; init-treemacs.el ends here
